home *** CD-ROM | disk | FTP | other *** search
/ Internet 53 / INTERNET53.iso / pc / software / windows / building / coldfusion studio evaluation / data1.cab / CFS_Wizards / CFML / DrillDown_Detail.wml < prev    next >
Encoding:
Text File  |  1998-10-08  |  2.4 KB  |  77 lines

  1. <WIZSET QueryFieldList = ''>
  2. <WIZSET FieldCount = '0'>
  3. <WIZLOOP index="CurrentField" list="$${DetailFields}">
  4.     <WIZSET FieldCount = FieldCount + 1>
  5.     <!---- field is in format 'sTable.sField=sType;nSize;bRequired' ---->
  6.     <WIZSET SeparatorPos = Find( CurrentField, '=' )>
  7.     <WIZSET TableFieldName = Left( CurrentField, SeparatorPos - 1 )>
  8.     <WIZSET QueryFieldList = QueryFieldList & TableFieldName & ' AS DetailField' & FieldCount & ', '>
  9. </WIZLOOP>
  10. <WIZSET QueryFieldList = Left( QueryFieldList, Len(QueryFieldList) - 2 )>
  11.  
  12.  
  13. <WIZSET QueryTableList = ''>
  14. <WIZLOOP index="i" list="$${Tables}">
  15.   <WIZSET QueryTableList = QueryTableList & i & ', '>
  16. </WIZLOOP>
  17. <WIZSET QueryTableList = Left( QueryTableList, Len(QueryTableList) - 2 )>
  18.  
  19.  
  20. <WIZSET QueryConditionList = ''>
  21. <WIZLOOP index="i" list="$${Joins}">
  22.   <WIZSET QueryConditionList = QueryConditionList & i & ' AND '>
  23. </WIZLOOP>
  24.  
  25. <!---- unique identifier field is in format 'sTable.sField=sType;nSize;bRequired' ---->
  26. <WIZSET Separator2Pos = Find( UniqueIdentifier, '=' )>
  27. <WIZSET Separator3Pos = Find( UniqueIdentifier, ';' )>
  28. <WIZSET TableFieldName = Left( UniqueIdentifier, Separator2Pos - 1 )>
  29. <WIZSET FieldType = Mid( UniqueIdentifier, Separator2Pos + 1, Separator3Pos - Separator2Pos - 1 )>
  30. <WIZIF FieldType EQ 'CHAR' OR FieldType EQ 'MEMO'>
  31. <WIZSET QueryConditionList = QueryConditionList & TableFieldName & " = '#URL.ID#'">
  32. <WIZELSE>
  33. <WIZSET QueryConditionList = QueryConditionList & TableFieldName & " = #URL.ID#">
  34. </WIZIF>
  35.  
  36.  
  37. <!--- Query returning detail information for selected item --->
  38. <CFQUERY name="Detail" dataSource="$${DataSource}">
  39.     SELECT $${QueryFieldList}
  40.     FROM $${QueryTableList}
  41.     WHERE $${QueryConditionList}
  42. </CFQUERY>
  43.  
  44.  
  45. <HTML><HEAD>
  46.     <TITLE>$${ApplicationName} - Detail</TITLE>
  47. </HEAD><BODY bgcolor="ffffff">
  48.  
  49.  
  50. <FONT size="+1">$${ApplicationName}</FONT> <BR>
  51. <FONT size="+2"><B>Detail</B></FONT>
  52.  
  53. <P>
  54.  
  55. <TABLE>
  56.  
  57. <CFOUTPUT query="Detail">
  58.  
  59. <WIZSET CurrentRow = 0>
  60. <WIZLOOP index="i" list="$${DetailFields}">
  61.     <WIZSET CurrentRow = CurrentRow + 1
  62.     ><WIZSET Separator1Pos = Find( i, '.' )
  63.     ><WIZSET Separator2Pos = Find( i, '=' )
  64.     ><WIZSET FieldName = Mid( i, Separator1Pos + 1, Separator2Pos - Separator1Pos - 1 )
  65.     ><TR>
  66.     <TD valign=top><B>$${FieldName}:</B></TD>
  67.     <TD valign=top>#DetailField$${CurrentRow}#</TD>
  68.     </TR>
  69. </WIZLOOP>
  70.  
  71. <TR><TD colspan=$${FieldCount}><HR></TD></TR>
  72. </CFOUTPUT>
  73.  
  74. </TABLE>
  75.  
  76.  
  77. </BODY></HTML>